<%
function LoadContent(path,usefso)
	if usefso then
		Set fs = CreateObject("Scripting.FileSystemObject")
		set f=fs.OpenTextFile(path)
		strContent=f.ReadAll
		f.close:set f=nothing
		set fs=nothing 
	else
		on error resume next
		set stream=Server.CreateObject("ADODB.Stream")
		If Err.Number=-2147221005 Then 
		   Response.Write "<div align='center'>不支持ADODB.Stream</div>"
		   Err.Clear
		   Response.End
		   End If
		
		with stream
		   .type=2
		   .mode=3
		   .Open
		   .LoadFromFile path
		   .Charset = "GB2312"
				 .Position = 2 
		   strContent=.ReadText
		end with
		stream.close:stream=nothing
	end if
	
	'LoadContent=strContent
	'response.write strContent
	LoadContent=strContent
end function

function WriteContent(path,content,overrite,usefso)
	if usefso=true then
		Set fs = CreateObject("Scripting.FileSystemObject")
		if overrite=true then
			set f=fs.CreateTextFile(path,overrite)
		else
			set f=fs.OpenTextFile(path,8)
		end if
		f.writeLine(content)
		f.close:set f=nothing
		set fs=nothing
	else 
		On Error Resume Next
			Set objStream = Server.CreateObject("ADODB.Stream")
		If Err.Number=-2147221005 Then 
			Response.Write "<div align='center'>不支持ADODB.Stream</div>"
			Err.Clear
			Response.End
		End If
		With objStream
				.Type = 2
				.Open
				.Charset = "utf-8"   '这里指定编码格式
				.Position = objStream.Size
				.WriteText = content
		'if override=true then
		   .SaveToFile path,2
		'else
		' .SaveToFile path,1
		'end if
				.Close
			End With
		Set objStream = Nothing
	end if
end function
%>